# 判断点 (xP, yP, zP) 是否在平面内(d=1)

scoreboard players operation t1 mt_surf_fill = xP mt_surf_fill
scoreboard players operation t1 mt_surf_fill *= surf_a mt_surf_fill

scoreboard players operation t2 mt_surf_fill = yP mt_surf_fill
scoreboard players operation t2 mt_surf_fill *= surf_b mt_surf_fill

scoreboard players operation t3 mt_surf_fill = zP mt_surf_fill
scoreboard players operation t3 mt_surf_fill *= surf_c mt_surf_fill

scoreboard players operation right mt_surf_fill = t1 mt_surf_fill
scoreboard players operation right mt_surf_fill += t2 mt_surf_fill
scoreboard players operation right mt_surf_fill += t3 mt_surf_fill

scoreboard players operation right mt_surf_fill += surf_d mt_surf_fill

scoreboard players operation right mt_surf_fill *= right mt_surf_fill

# tellraw @a ["r1: ",{"score": {"name":"r1","objective": "mt_surf_fill"}},", r2: ",{"score": {"name":"r2","objective": "mt_surf_fill"}},", r3: ",{"score": {"name":"r3","objective": "mt_surf_fill"}}]

execute if score left mt_surf_fill > right mt_surf_fill run function mountain:surf_fill/judge_in